//
//  MyActivityCell.m
//  YiBaoStore
//
//  Created by 毛云河 on 2019/1/5.
//  Copyright © 2019 小河. All rights reserved.
//

#import "MyActivityCell.h"
#import "ActivityModel.h"

@implementation MyActivityCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self setSearchHisCell];
    }
    return self;
}

- (void)setSearchHisCell
{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.activityImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.activityImageView];
    self.activityImageView.backgroundColor = RGBACOLOR(204, 204, 204, 1);
    
    self.lookBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.contentView addSubview:self.lookBtn];
    self.lookBtn.backgroundColor = BtnBgColor;
    self.lookBtn.titleLabel.font = FontWithSize(12);
    self.lookBtn.layer.cornerRadius = 15;
    self.lookBtn.layer.masksToBounds = YES;
    [self.lookBtn setTitle:@"查看操作指引>" forState:UIControlStateNormal];
    [self.lookBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.activityImageView.frame  =CGRectMake(20, 15, SCREENWIDTH-40, 155);
    self.lookBtn.frame  =CGRectMake(SCREENWIDTH-120, self.activityImageView.bottom+10, 100, 30);
}

- (void)setCellModel:(ActivityModel *)model
{
    [self.activityImageView sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:[UIImage imageNamed:@""]];
}

@end
